import Vue from 'vue'
import Router from 'vue-router'
const view = name => () => import(`@/pages/${name}`)

Vue.use(Router)

const routes = [
  {
    path: '/',
    name: 'Home',
    meta: {
      role: 1
    },
    component: view('Home')
  }
]

const router = new Router({
  mode: 'history',
  routes
})

router.beforeEach((to, form, next) => {
  next()
})

export default router
